﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace StockControlSystem
{
    class Controller
    {
        private List<Stock> m_allStocks;
        private List<Supplier> m_allSuppliers;

        public Controller()
        {
            m_allStocks = new List<Stock>();
            m_allSuppliers = new List<Supplier>();
        }

        public void AddStock(Stock sto, int supKey)
        {
            sto.AddSupplier(m_allSuppliers[supKey - 1]);
            m_allStocks.Add(sto);
        }

        public void AddSupplier(Supplier sup)
        {
            m_allSuppliers.Add(sup);
        }

        public string[] GetAllSuppliersDescrition()
        {
            List<string> res = new List<string>();
            for (int i = 0; i < m_allSuppliers.Count; ++i)
            {
                res.Add(m_allSuppliers[i].Description);
            }
            return res.ToArray();
        }
    }
}
